package com.saturn.action.auth.report;

import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;

import com.saturn.app.utils.BeanUtils;
import com.saturn.app.web.IAction;
import com.saturn.app.web.IView;
import com.saturn.app.web.view.JspErrorView;
import com.saturn.app.web.view.JspView;
import com.saturn.report.ReportView;

public class AddReportViewAction implements IAction {

	@Override
	public IView execute(HttpServletRequest request,
			HttpServletResponse response) {
		
		ReportView reportView = BeanUtils.getBean(request, ReportView.class);

		if (ReportView.add(reportView) == 1) {
			return new JspView("/report/reportView/showReportView.jsp");
		} else {
			return new JspErrorView("添加报表显示失败");
		}
	}

	@Override
	public String requestMapping() {
		return "/auth/report/addReportView.action";
	}

}
